package com.landinfo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * 设备管理
 * Create by lzq
 * 2017-06-06
 */
@ApiModel(description = "设备管理 Create by lzq 2017-06-06")
@Entity
@Table(name = "equipment_management",uniqueConstraints = {@UniqueConstraint(columnNames="imei")})
public class EquipmentManagement implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
    @SequenceGenerator(name = "sequenceGenerator")
    private Long id;

    /**
     * 设备名称
     */
    @NotNull
    @Size(max = 100)
    @ApiModelProperty(value = "设备名称", required = true)
    @Column(name = "name", length = 100, nullable = false)
    private String name;

    /**
     * imei号
     */
    @Size(max = 100)
    @ApiModelProperty(value = "imei号")
    @Column(name = "imei", length = 100)
    private String imei;

    /**
     * 序列号
     */
    @Size(max = 100)
    @ApiModelProperty(value = "序列号")
    @Column(name = "serial_number", length = 100)
    private String serialNumber;

    /**
     * meid号
     */
    @Size(max = 100)
    @ApiModelProperty(value = "meid号")
    @Column(name = "meid", length = 100)
    private String meid;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Column(name = "remark")
    private String remark;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_date")
    private ZonedDateTime createDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public EquipmentManagement name(String name) {
        this.name = name;
        return this;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImei() {
        return imei;
    }

    public EquipmentManagement imei(String imei) {
        this.imei = imei;
        return this;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public EquipmentManagement serialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
        return this;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getMeid() {
        return meid;
    }

    public EquipmentManagement meid(String meid) {
        this.meid = meid;
        return this;
    }

    public void setMeid(String meid) {
        this.meid = meid;
    }

    public String getRemark() {
        return remark;
    }

    public EquipmentManagement remark(String remark) {
        this.remark = remark;
        return this;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public ZonedDateTime getCreateDate() {
        return createDate;
    }

    public EquipmentManagement createDate(ZonedDateTime createDate) {
        this.createDate = createDate;
        return this;
    }

    public void setCreateDate(ZonedDateTime createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        EquipmentManagement equipmentManagement = (EquipmentManagement) o;
        if (equipmentManagement.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), equipmentManagement.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "EquipmentManagement{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", imei='" + getImei() + "'" +
            ", serialNumber='" + getSerialNumber() + "'" +
            ", meid='" + getMeid() + "'" +
            ", remark='" + getRemark() + "'" +
            ", createDate='" + getCreateDate() + "'" +
            "}";
    }
}
